package com.dhcc.bpm.modules.orga.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.bpm.modules.api.vo.ApiVO;
import com.dhcc.bpm.modules.orga.entity.App;
import com.dhcc.bpm.modules.orga.entity.AppApi;
import com.dhcc.bpm.modules.orga.mapper.AppApiMapper;
import com.dhcc.bpm.modules.orga.service.IAppApiService;
import com.dhcc.bpm.modules.orga.vo.AppApiVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName AppApiServiceImpl
 * @Description 应用API关系表 服务实现类
 * @Author daina
 * @Date 2020/2/24 19:25
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Service("opc_app_api")
public class AppApiServiceImpl extends ServiceImpl<AppApiMapper, AppApi> implements IAppApiService {


	@Override
	public IPage<AppApiVO> selectAppApiPage(IPage<AppApiVO> page, AppApiVO appApi) {
		return page.setRecords(baseMapper.selectAppApiPage(page, appApi));
	}
	@Override
	public IPage<AppApiVO> listApiByAppId(IPage<AppApiVO> page, AppApiVO appApi) {
		return page.setRecords(baseMapper.listApiByAppId(page, appApi));
	}

	@Override
	public IPage<AppApiVO> listApiByApiId(IPage<AppApiVO> page, AppApiVO appApi) {
		return page.setRecords(baseMapper.listApiByApiId(page, appApi));
	}
	@Override
	public List<AppApiVO> findApiList(App detail, String env) {
		return baseMapper.findApiList(detail.getId(), env);
	}

	@Override
	public List<AppApiVO> findApiListByAppId(Long appId) {
		return baseMapper.findApiListByAppId(appId);
	}

	@Override
	public List<ApiVO> getApiListByProductId(Long opcAppId, Long opcProductId) {
		return baseMapper.getApiListByProductId(opcAppId, opcProductId);
	}

	@Override
	public int deleteByAppId(Long opcAppId, String approvalEnv) {
		return baseMapper.deleteByAppId(opcAppId, approvalEnv);
	}

	@Override
	public int deleteByApiId(String opcApiId, String productId, String approvalEnv) {
		return baseMapper.deleteByApiId(opcApiId, productId, approvalEnv);
	}

	@Override
	public int deleteAppApi(String opcApiId, String appId, String approvalEnv) {
		return baseMapper.deleteAppApi(opcApiId, appId, approvalEnv);
	}

	@Override
	public AppApi findByAppApiId(String opcApiId, String appId, String approvalEnv) {
		return baseMapper.findByAppApiId(opcApiId, appId, approvalEnv);
	}

	@Override
	public int deleteAppApiByAppId(Long opcAppId) {
		return baseMapper.deleteAppApiByAppId(opcAppId);
	}

	@Override
	public List<AppApi> selectByAppId(Long opcAppId) {
		return baseMapper.selectByAppId(opcAppId);
	}

	@Override
	public List<AppApi> selectByAppIdStatus(String opcAppId, String validStatus) {
		return baseMapper.selectByAppIdStatus(opcAppId, validStatus);
	}

	@Override
	public List<AppApi> selectByApiId(Long opcApiId) {
		return baseMapper.selectByApiId(opcApiId);
	}
	@Override
	public List<AppApi> selectByApiIdEnv(Long opcApiId, Long productId, String env) {
		return baseMapper.selectByApiIdEnv(opcApiId, productId, env);
	}

	@Override
	public List<AppApi> selectByProductId(Long opcProductId) {
		return baseMapper.selectByProductId(opcProductId);
	}

	@Override
	public List<AppApi> selectAppApiList(AppApi appApi) {
		return baseMapper.selectAppApiList(appApi);
	}

	@Override
	public int updateAppApi(AppApi appApi) {
		return baseMapper.updateAppApi(appApi);
	}

	@Override
	public int delAppApiByAppId(List<Long> appIds) {
		return baseMapper.delAppApiByAppId(appIds);
	}

	@Override
	public int delCaseApiByCaseIds(List<Long> caseIds) {
		return baseMapper.delCaseApiByCaseIds(caseIds);
	}

	@Override
	public int delCaseById(List<Long> ids) {
		return baseMapper.delCaseById(ids);
	}

	@Override
	public List<Long> selectAppCaseByAppIds(List<Long> appIds) {
		return baseMapper.selectAppCaseByAppIds(appIds);
	}


}
